<?php
header("content-type:text/html;charset=utf8");
$pdo = new PDO("mysql:host=127.0.0.1;dbname=11-9;charset=utf8",'root','root');
$name = isset($_POST['name'])?$_POST['name']:"";
$pwd = isset($_POST['pwd'])?$_POST['pwd']:"";
$sql = "select * from user where name='$name' and pwd = '$pwd'";
$res = $pdo->query($sql);
if ($res)
{
    echo "<script>alert('登录成功');location.href='show.php'</script>";
}else{
    echo "<script>alert('登录失败');location.href='denglu.html'</script>";
}

?>